package com.kimu.order_service_interface.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.Data;
import lombok.RequiredArgsConstructor;

/**
 * 订单实体类
 */
@Data
@RequiredArgsConstructor
@TableName("`orders`")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * 订单ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    
    /**
     * 订单编号
     */
    @TableField(value = "order_no")
    private String orderNo;
    
    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Long userId;
    
    /**
     * 订单总金额
     */
    @TableField(value = "total_amount")
    private BigDecimal totalAmount;
    
    /**
     * 订单状态：0-待付款，1-已付款，2-已发货，3-已完成，4-已取消
     */
    private OrderStatus status;
    
    /**
     * 收货地址
     */
    @TableField(value = "shipping_address")
    private String shippingAddress;
    
    /**
     * 收货人姓名
     */
    @TableField(value = "shipping_name")
    private String shippingName;
    
    /**
     * 收货人电话
     */
    @TableField(value = "shipping_phone")
    private String shippingPhone;
    
    /**
     * 支付方式
     */
    @TableField(value = "payment_method")
    private String paymentMethod;
    
    /**
     * 支付时间
     */
    @TableField(value = "payment_time")
    private LocalDateTime paymentTime;
    
    /**
     * 发货时间
     */
    @TableField(value = "shipping_time")
    private LocalDateTime shippingTime;
    
    /**
     * 完成时间
     */
    @TableField(value = "completion_time")
    private LocalDateTime completionTime;
    
    /**
     * 创建时间
     */
    @TableField(value = "created_time")
    private LocalDateTime createdTime;
    
    /**
     * 更新时间
     */
    @TableField(value = "updated_time")
    private LocalDateTime updatedTime;
    
    /**
     * 是否删除
     */
    @TableField(value = "is_deleted")
    private Boolean isDeleted;
}
